<?php
namespace yan\editor_frontend\editor;
use yii\helpers\Html;

class WebImagesWidget extends \yii\base\Widget{
	public $value;
	public $child;
	public $that;
    public $parent_type;

	public function run(){
		ImagesAsset::register($this->view);

		$shtml = Html::beginTag('div', [
			'class'=>'WebImagesWidget '.(isset($this->value['value']['class']) ? $this->value['value']['class'] : ''),
			'style'=>(isset($this->value['value']['style']) ? $this->value['value']['style'] : ''),
			'id'=>(isset($this->value['value']['class_id']) ? $this->value['value']['class_id'] : ''),
		]);
		
		foreach ((array)$this->value['value']['content'] as $key => $val) {
			$shtml .= '<div class="item">'.Html::img( $val ).'</div>';
		}
		$shtml .= Html::endTag('div');
		return $shtml;
	}
}